package request

import (
	"gitee.com/cjsn/topsdk/ability254/domain"
	"gitee.com/cjsn/topsdk/util"
)

type TmallServicecenterSpserviceorderCreateRequest struct {
	/*
	   服务产品id     */
	ServiceProductId *int64 `json:"service_product_id" required:"true" `
	/*
	   服务对象类型     */
	ServiceObjectType *string `json:"service_object_type" required:"true" `
	/*
	   服务对象类型名称     */
	ServiceObjectName *string `json:"service_object_name,omitempty" required:"false" `
	/*
	   服务内容     */
	ServiceContent *string `json:"service_content" required:"true" `
	/*
	   服务计价json     */
	ServiceProperties *map[string]interface{} `json:"service_properties" required:"true" `
	/*
	   品牌id     */
	BrandId *int64 `json:"brand_id,omitempty" required:"false" `
	/*
	   消费者信息     */
	Buyer *domain.TmallServicecenterSpserviceorderCreateBuyerDTO `json:"buyer" required:"true" `
	/*
	   预约信息     */
	Reservation *domain.TmallServicecenterSpserviceorderCreateReservationDTO `json:"reservation,omitempty" required:"false" `
	/*
	   数量     */
	ServiceCount *int64 `json:"service_count" required:"true" `
	/*
	   外部单号     */
	OutOrderId *string `json:"out_order_id" required:"true" `
	/*
	   外部渠道     */
	Source *string `json:"source" required:"true" `
	/*
	   额外业务信息     */
	ExtJson *map[string]interface{} `json:"ext_json,omitempty" required:"false" `
	/*
	   备注     */
	Memo *string `json:"memo,omitempty" required:"false" `
}

func (s *TmallServicecenterSpserviceorderCreateRequest) SetServiceProductId(v int64) *TmallServicecenterSpserviceorderCreateRequest {
	s.ServiceProductId = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetServiceObjectType(v string) *TmallServicecenterSpserviceorderCreateRequest {
	s.ServiceObjectType = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetServiceObjectName(v string) *TmallServicecenterSpserviceorderCreateRequest {
	s.ServiceObjectName = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetServiceContent(v string) *TmallServicecenterSpserviceorderCreateRequest {
	s.ServiceContent = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetServiceProperties(v map[string]interface{}) *TmallServicecenterSpserviceorderCreateRequest {
	s.ServiceProperties = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetBrandId(v int64) *TmallServicecenterSpserviceorderCreateRequest {
	s.BrandId = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetBuyer(v domain.TmallServicecenterSpserviceorderCreateBuyerDTO) *TmallServicecenterSpserviceorderCreateRequest {
	s.Buyer = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetReservation(v domain.TmallServicecenterSpserviceorderCreateReservationDTO) *TmallServicecenterSpserviceorderCreateRequest {
	s.Reservation = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetServiceCount(v int64) *TmallServicecenterSpserviceorderCreateRequest {
	s.ServiceCount = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetOutOrderId(v string) *TmallServicecenterSpserviceorderCreateRequest {
	s.OutOrderId = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetSource(v string) *TmallServicecenterSpserviceorderCreateRequest {
	s.Source = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetExtJson(v map[string]interface{}) *TmallServicecenterSpserviceorderCreateRequest {
	s.ExtJson = &v
	return s
}
func (s *TmallServicecenterSpserviceorderCreateRequest) SetMemo(v string) *TmallServicecenterSpserviceorderCreateRequest {
	s.Memo = &v
	return s
}

func (req *TmallServicecenterSpserviceorderCreateRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.ServiceProductId != nil {
		paramMap["service_product_id"] = *req.ServiceProductId
	}
	if req.ServiceObjectType != nil {
		paramMap["service_object_type"] = *req.ServiceObjectType
	}
	if req.ServiceObjectName != nil {
		paramMap["service_object_name"] = *req.ServiceObjectName
	}
	if req.ServiceContent != nil {
		paramMap["service_content"] = *req.ServiceContent
	}
	if req.ServiceProperties != nil {
		paramMap["service_properties"] = util.ConvertStruct(*req.ServiceProperties)
	}
	if req.BrandId != nil {
		paramMap["brand_id"] = *req.BrandId
	}
	if req.Buyer != nil {
		paramMap["buyer"] = util.ConvertStruct(*req.Buyer)
	}
	if req.Reservation != nil {
		paramMap["reservation"] = util.ConvertStruct(*req.Reservation)
	}
	if req.ServiceCount != nil {
		paramMap["service_count"] = *req.ServiceCount
	}
	if req.OutOrderId != nil {
		paramMap["out_order_id"] = *req.OutOrderId
	}
	if req.Source != nil {
		paramMap["source"] = *req.Source
	}
	if req.ExtJson != nil {
		paramMap["ext_json"] = util.ConvertStruct(*req.ExtJson)
	}
	if req.Memo != nil {
		paramMap["memo"] = *req.Memo
	}
	return paramMap
}

func (req *TmallServicecenterSpserviceorderCreateRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
